{$xp_currentnav_html.'<!--END-->'}
<form id="mdmconfig-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group"> 
        <label class="control-label col-xs-12 col-sm-2">{:__('Mdmtabletype')}:</label> 
        <div class="col-xs-12 col-sm-8"> 
                         
            <select id="c-mdmtabletype" class="form-control selectpicker {if $row.mdmtabletype}readonly{/if}" name="row[mdmtabletype]" > 
                {foreach name="mdmtabletypeList" item="vo"} 
                    <option value="{$key|htmlentities}" {in name="key" value="$row.mdmtabletype"}selected{/in}>{$vo|htmlentities}</option> 
                {/foreach} 
            </select> 
  
        </div> 
    </div> 

    {if !$row.mdmtabletype}
    <div class="form-group" data-favisible="mdmtabletype=select_table"> 
        <label class="control-label col-xs-12 col-sm-2">{:__('Mdmtablename')}:</label> 
        <div class="col-xs-12 col-sm-8"> 
            <input id="c-selectmdmtablename" class="form-control selectpage" name="row[selectmdmtablename]" type="text" value="{$row.selectmdmtablename|htmlentities}"
            data-source="csmitsm/xcflow/selectTables" data-primary-key="name" data-field="displayname" > 
        </div> 
    </div> 
    <div class="form-group" data-favisible="mdmtabletype=create_table"> 
        <label class="control-label col-xs-12 col-sm-2">{:__('Mdmtablename')}:</label> 
        <div class="col-xs-12 col-sm-8"> 
            <input id="c-createmdmtablename" readonly class="form-control" name="row[createmdmtablename]" type="text" value="{$row.createmdmtablename|htmlentities}"> 
        </div> 
    </div> 
    {/if}

    {if $row.mdmtabletype}
    <div class="form-group"> 
        <label class="control-label col-xs-12 col-sm-2">{:__('Mdmtablename')}:</label> 
        <div class="col-xs-12 col-sm-8"> 
            <input id="c-mdmtablename" class="form-control" readonly name="row[mdmtablename]" type="text" value="{$row.mdmtablename|htmlentities}"> 
        </div> 
    </div> 
    {/if}




    <div class="form-group {if !$row.mdmtabletype}hidden{/if}"  > 
        <label class="control-label col-xs-12 col-sm-2">{:__('Mdmfieldjson')}:</label> 
        <div class="col-xs-12 col-sm-8">
            <table class="table fieldlist" data-template="basictpl" data-name="row[mdmfieldjson]" id="first-table">
                <tr>
                    <td>{:__('流程字段')}</td>
                    <td>{:__('归档字段')}</td>
                    <td>{:__('主键')}</td>
                    <td>{:__('生效')}</td>
                    <td width="100"></td>
                </tr>
                <tr>
                    <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                </tr>
            </table>

            <textarea name="row[mdmfieldjson]" class="form-control hidden" cols="30" rows="5">{$row.mdmfieldjson|htmlentities}</textarea>
            <!-- [{"flowfieldcode":"1","mdmfieldcode":"MF1","pk":1,"status":1}] -->
            <script id="basictpl" type="text/html">
                <tr class="form-inline">
                    <td>
                        <input type="text" name="<%=name%>[<%=index%>][flowfieldcode]" class="form-control" value="<%=row.flowfieldcode%>" readonly>
                      </td>
                    <td><input type="text" name="<%=name%>[<%=index%>][mdmfieldcode]" class="form-control selectpage"  size="28" value="<%=row.mdmfieldcode%>" placeholder=""
                        data-source="csmitsm/xcflow/selectTablefields" data-field="displayname" data-params='{"custom[tablename]":"{$row.mdmtablename|htmlentities}"}' data-primary-key="name" /></td>
                    <td>
                        <input type="hidden" name="<%=name%>[<%=index%>][pk]" id="c-pk-<%=index%>" class="form-control" style="width:50px" value="<%=row.pk%>" placeholder="主键"/>
                        <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-pk-<%=index%>" data-yes="1" data-no="0">
                            <i class="fa fa-toggle-on text-success <%if(row.pk!=1){%>fa-flip-horizontal text-gray<%}%> fa-2x"></i>
                        </a>
                    </td>                   
                    <td>
                        <input type="hidden" name="<%=name%>[<%=index%>][status]" id="c-status-<%=index%>" class="form-control" style="width:50px" value="<%=row.status%>" placeholder="状态"/>
                        <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-status-<%=index%>" data-yes="1" data-no="0">
                            <i class="fa fa-toggle-on text-success <%if(row.status!=1){%>fa-flip-horizontal text-gray<%}%> fa-2x"></i>
                        </a>
                    </td>
                    <td>
                        <!--下面的两个按钮务必保留-->
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                    </td>
                </tr>
            </script>
        </div>
    </div> 
    {if !$row.mdmtabletype}
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">下一步: 配置字段</button>
        </div>
    </div>
    {/if}
    {if $row.mdmtabletype}
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
    {/if}
</form>